package eScrum.pages;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import eScrum.components.MWindow;
import eScrum.panels.CreateProjectPopUp;
import eScrum.panels.CreateUserPopUpPanel;


@AuthorizeInstantiation({ "DEVELOPER", "POWERUSER","CLASSICUSER" })
public class MainDashboard  extends TeleBasePage{

	private static final long serialVersionUID = 1039252787910915677L;
	
	private ModalWindow window;
	
	public MainDashboard(PageParameters params) {
		super(params);
		addModalWindow();
		
		add(new AjaxLink<Object>("edit") {

			private static final long serialVersionUID = -697886248486773830L;

			@Override
			public void onClick(AjaxRequestTarget target) {

				window.setTitle(getString("createProject"));
				window.setContent(new CreateProjectPopUp(window.getContentId()) {

/*					@Override
					public void refreshData(AjaxRequestTarget target) {
						super.refreshData(target);
						target.add(userListContainer);
						target.add(footer);
					}*/

				});
				window.setInitialHeight(300);
				window.setInitialWidth(780);
				window.show(target);
			}
		});
		
		

	}

	private void addModalWindow() {
		window = new MWindow("modalUserPage");
		window.setTitle("Create Project");
		window.setInitialHeight(300);
		window.setInitialWidth(780);
		window.setResizable(false);
		add(window);		
	}
	
	
	
	

}
